/**
 * @author 0283000115
 * @date 2018年6月19日-下午3:57:46
 */
package com.zte.claa.inficombo.csa.app.service.svrmoni;

/**
 * @author 0283000115
 *
 */
public class ServerNode {
	public static final String DTFormat = "yyyy-MM-dd HH:mm:ss";
	public static final String TIME_ZONE = "GMT+8";
	
	public static final int RUN_ST_ONLINE = 1;
	public static final int RUN_ST_OFFLINE = 2;
	public static final int RUN_ST_UNKNOWN = 3;
	
	public static final int SVR_TP_BASE= 1;
	public static final int SVR_TP_WEB = 2;
	public static final int SVR_TP_CSA = 3;
	public static final int SVR_TP_API = 4;
	public static final int SVR_TP_REDIS = 5;
	
	private String svrname;
	private String svrid;
	private int svrtype;
	private int runstate = RUN_ST_UNKNOWN;
	private long starttime; 	
	private long rpttime; 
	private String ipaddr;
	private int svrport;
	private int svrInstanceNo = 1;
	
	public ServerNode(){
		
	}

	/**
	 * @return the svrname
	 */
	public String getSvrname() {
		return svrname;
	}

	/**
	 * @param svrname the svrname to set
	 */
	public void setSvrname(String svrname) {
		this.svrname = svrname;
	}

	/**
	 * @return the svrid
	 */
	public String getSvrid() {
		return svrid;
	}

	/**
	 * @param svrid the svrid to set
	 */
	public void setSvrid(String svrid) {
		this.svrid = svrid;
	}

	/**
	 * @return the svrtype
	 */
	public int getSvrtype() {
		return svrtype;
	}

	/**
	 * @param svrtype the svrtype to set
	 */
	public void setSvrtype(int svrtype) {
		this.svrtype = svrtype;
	}

	/**
	 * @return the runstate
	 */
	public int getRunstate() {
		return runstate;
	}

	/**
	 * @param runstate the runstate to set
	 */
	public void setRunstate(int runstate) {
		this.runstate = runstate;
	}

	/**
	 * @return the starttime
	 */
	public long getStarttime() {
		return starttime;
	}

	/**
	 * @param starttime the starttime to set
	 */
	public void setStarttime(long starttime) {
		this.starttime = starttime;
	}

	/**
	 * @return the rpttime
	 */
	public long getRpttime() {
		return rpttime;
	}

	/**
	 * @param rpttime the rpttime to set
	 */
	public void setRpttime(long rpttime) {
		this.rpttime = rpttime;
	}

	/**
	 * @return the ipaddr
	 */
	public String getIpaddr() {
		return ipaddr;
	}

	/**
	 * @param ipaddr the ipaddr to set
	 */
	public void setIpaddr(String ipaddr) {
		this.ipaddr = ipaddr;
	}

	/**
	 * @return the svrport
	 */
	public int getSvrport() {
		return svrport;
	}

	/**
	 * @param svrport the svrport to set
	 */
	public void setSvrport(int svrport) {
		this.svrport = svrport;
	}
	
	public int getSvrInstanceNo() {
		return svrInstanceNo;
	}

	public void setSvrInstanceNo(int svrInstanceNo) {
		this.svrInstanceNo = svrInstanceNo;
	}

	/**
	 * 
	 * @param svrTp
	 * @return
	 */
	public static String parseSvrNodeType(int svrTp){
		String nm = "";
		switch(svrTp){
		case SVR_TP_BASE:
			nm = "BASE";
			break;
		case SVR_TP_WEB:
			nm = "WEB";
			break;
		case SVR_TP_CSA:
			nm = "CSA";
			break;
		case SVR_TP_API:
			nm = "API";
			break;
		case SVR_TP_REDIS:
			nm = "CACHE";
			break;
		}
		return nm;
	}
	
}
